The present invention relates to an apparatus and a method for writing and reading data to and from a tape medium. In particular, the present invention relates to an apparatus and a method for writing and reading data, designated by an upper-level apparatus, to and from a recording medium.
In a tape drive such as a linear tape-open (LTO) drive, a SCSI command is used for communicating with a host. Accordingly, a host designates a logical position on a tape by using the number of records, filemarks, a serial number, or the like. A filemark is written to indicate a segment of files after multiple records are written as a file. Here, the size of a record is in variable length.
Meanwhile, an LTO tape drive records data to a tape in recording units called data sets. Although the data amount of a data set is in fixed length, a record is compressed to be stored therein. For this reason, even if the number of a record and the size of all of the records are given, it is difficult to specify a data set in which the record is stored.
Moreover, in LTO, a reading head located just behind a writing head is used to read data immediately after the data is recorded by use of the writing head, so as to check whether or not the data is recorded properly. If the data is not recorded properly, the data is recorded again to a different position (normally, a logically latter position) in data set units or in units smaller than data sets. Thus, even if a data set can be specified, it is difficult to specify the physical position of the data set on a tape.
Against this background, in LTO, information called a tape directory is recorded to a contactless nonvolatile memory called cartridge memory (CM) provided inside a tape cartridge, so that the tape can be moved to a target position at high speed when a SCSI command for position movement such as Locate, Space, or the like is issued. A tape directory usually includes, for each wrap, information such as the last data set number, the number of records contained in the first half, the number of filemarks contained in the first half, the number of records contained in the latter half, and the number of filemarks contained in the latter half. Here, a wrap refers to a group of tracks included in a one-way movement of the head in a linear recording (reciprocal recording) method such as LTO.
When a Locate command or a Space command is executed, the use of such information in a tape directory eliminates the need for a position search conducted by reading all data from the logical beginning of a tape. Accordingly, a tape can be moved to a target position at a higher speed than in the conventional case. However, the record number written in a data set still needs to be read by running the tape from the beginning or the middle of a wrap by the maximum length of one wrap, that is, 600 m to 800 m (by half the length on average), at the rate of approximately 5 to 6 m/sec. Hence, the operation still requires a considerable amount of time.
Meanwhile, for the case of not reading the content of a data set, there is provided a method in which a LPOS, which is a physical position on a tape, is used. Here, the LPOS is read from linear position registration data that is modulated into a pre-recorded servo pattern on a recording medium (refer to Japanese Patent Translation Publication No. 2003-500788, for example). In this case, a physical position within half a wrap is estimated by linear interpolation on the basis of the target record number, by running the tape at a higher rate of approximately 8 to 12 m/sec while reading the LPOS. Thus, the operation can be sped up even more. However, since the estimation is made by linear interpolation, it is more likely that the estimated physical position is wrong in the case where the record sizes are not uniform. In other words, estimation of physical position needs to be repeated so as to perform high-speed movement again in the following cases: although the estimated physical position is attained, the target record is still far ahead of the estimated physical position; the estimated physical position goes further than the target record; and the like.
With the recent tendency of increase in archive data using tapes, an increase is also expected in reference of such archive data. Hence, it would be desirable to enhance performance of a Locate command and a Space command even more. Accordingly, it would be desirable t provide a mechanism and/or method for detecting a record number or the like during high-speed movement of a tape medium.